/**
 * 
 */
package info.niwota.webshot;

import android.app.Application;
import android.util.Log;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;
import dalvik.system.VMRuntime;

/**
 * @author qiangli
 * 
 */
public class WebApplication extends Application {
	private final static String LOGTAG = "WebApplication";

	final static boolean DEBUG = Debug.DEBUG;

	/**
	 * Specifies a heap utilization ratio that works better for the browser than
	 * the default ratio does.
	 */
	private final static float TARGET_HEAP_UTILIZATION = 0.75f;

	public void onCreate() {
		if (DEBUG) {
			Log.d(LOGTAG, "Browser.onCreate: " + this);
		}
		VMRuntime.getRuntime()
				.setTargetHeapUtilization(TARGET_HEAP_UTILIZATION);
		//
		CookieSyncManager.createInstance(this);
		// remove all expired cookies
		CookieManager.getInstance().removeExpiredCookie();
	}
}
